import request from '@/utils/request'

// 查询培训班主列表
export function listTrainingClass(query) {
  return request({
    url: '/training/TrainingClass/list',
    method: 'get',
    params: query
  })
}

// 查询培训班主详细
export function getTrainingClass(trainingClassId) {
  return request({
    url: '/training/TrainingClass/' + trainingClassId,
    method: 'get'
  })
}

// 新增培训班主
export function addTrainingClass(data) {
  return request({
    url: '/training/TrainingClass',
    method: 'post',
    data: data
  })
}

// 修改培训班主
export function updateTrainingClass(data) {
  return request({
    url: '/training/TrainingClass',
    method: 'put',
    data: data
  })
}

// 删除培训班主
export function delTrainingClass(trainingClassId) {
  return request({
    url: '/training/TrainingClass/' + trainingClassId,
    method: 'delete'
  })
}

//通过项目和条件查询培训班主列表
export function trainingClassList(query) {
  return request({
    url: '/training/TrainingClass/trainingClassList',
    method: 'get',
    params: query
  })
}

// 保存班级人员分配信息
export function savePeopleAllocation(data) {
  return request({
    url: '/training/TrainingClass/save',
    method: 'post',
    data: data
  })
}
// 根据班级ID查询人员分配信息
export function queryPeopleAllocation(trainingClassId) {
  return request({
    url: '/training/TrainingClass/query/' + trainingClassId,
    method: 'get'
  })
}
// 获取培训班vo详细信息
export function getInfoByTrainingClassId(trainingClassId) {
  return request({
    url: `/training/TrainingClass/getById/${trainingClassId}`,
    method: 'get'
  })
}

// 保存班级人员分配信息
export function classHandover(data) {
  return request({
    url: '/training/TrainingClass/classHandover',
    method: 'post',
    data: data
  })
}

//班主任查询我的班级列表
export function myClasses(query) {
  return request({
    url: '/training/TrainingClass/myClasses',
    method: 'get',
    params: query
  })
}

//通过培训班id获取培训班考试设置
export function getExamInfoById(trainingClassId) {
  return request({
    url: '/training/TrainingClass/getExamInfoById/'+trainingClassId,
    method: 'get'
  })
}

//设置培训班考试
export function setExam(data) {
  return request({
    url: '/training/TrainingClass/setExam',
    method: 'put',
    data: data
  })
}

//学员查询我的班级列表
export function studentClasses(studentId) {
  return request({
    url: '/training/TrainingClass/studentClasses/'+studentId,
    method: 'get'
  })
}
